/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.gob.foncodes.sega.bs.services;

import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pe.gob.foncodes.sega.bs.dao.DemoStatesDao;
import pe.gob.foncodes.sega.bs.domain.DemoStates;
import pe.gob.foncodes.sega.bs.transfer.bk.DemoStatesBk;
import pe.gob.foncodes.sega.bs.util.FuncionesSaticas;

/**
 *
 * @author Jesus
 */
@Service
public class SegaServices {
    
    @Autowired
    public DemoStatesDao demoStatesDao;
    
    public List<DemoStatesBk> obtenerListaEstados(){
        List<DemoStatesBk> demoStatesBk = new ArrayList<DemoStatesBk>();
        try{
            List<DemoStates>  demoStates = demoStatesDao.getAllDemoStates();
            for(DemoStates p:demoStates){
                DemoStatesBk demoStateBk = new DemoStatesBk();
                FuncionesSaticas.copyPropertiesObject(demoStateBk, p);
                demoStatesBk.add(demoStateBk);
            }
        }catch(Exception e){
            e.printStackTrace();
        }
        return demoStatesBk;
    }
}
